<?php $this->load->view('partial/head'); ?>

<h2>FORM PENGISIAN KUISIONER</h2>

<?php if($pesan != NULL){
	echo "<div class='form-info ".($pesan['success'] ? 'success' : 'fail')."'>".$pesan['pesan']."</div>";
} ?>

<form method="post" action="<?= base_url()."index.php/cs/save_vote_kuisioner" ?>">	
	<table cellpadding="10">
		<thead>
			<tr>
				<th>Pertanyaan</th>
				<th>Pilihan Jawaban</th>
			</tr>
		</thead>
		<tbody>
		<?php foreach ($kuisioner as $kuisioner){ ?>
			<tr>
				<td><?=$kuisioner['pertanyaan']?></td>
				<td><?php foreach($kuisioner['pilihan'] as $pilihan){ ?>
						<input type="radio" value="<?=$pilihan['id_pilihan']?>" name="vote<?=$kuisioner['id_kuisioner']?>[]"><?=$pilihan['isi']?></input>
						<input type="hidden" value="<?=$pilihan['jumlah_vote']?>" name="jumlah_vote<?=$kuisioner['id_kuisioner']?>[]" />
					<?php } ?>
				</td>
			</tr>
		<?php } ?>
		<tr>
			<td colspan="2">
				<input type="submit" value="Simpan" />
			</td>
		</tr>
	</table>
</form>